<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var min = 0;
    var max = 0;
    //从小到大排序
    var arr = [100,4,35,64,12,6];
    function w(a,b) {
        return a - b
    }
    console.log(arr.sort(w));
    console.log("最小值"+arr.shift());
    console.log("最大值"+arr.pop());
    console.log("最大值"+max);
    console.log("最小值"+min);

</script>
</body>
</html>